package com.liuqinqi.barter.controller;

import com.liuqinqi.barter.common.serverResponse.RequestDTO;
import com.liuqinqi.barter.common.serverResponse.ServerResponse;
import com.liuqinqi.barter.model.Member;
import com.liuqinqi.barter.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/member")
public class MemberController {

    @Autowired
    private MemberService memberService;

    @PostMapping("/test")
    public ServerResponse<String> test(@RequestBody  RequestDTO requestDTO){
        String test = requestDTO.getParam("test");
        return memberService.Test(test);
    }

    @PostMapping("/register")
    public ServerResponse<Member> register(@RequestBody Member member){
        return memberService.register(member);
    }
}
